#define _CRT_SECURE_NO_WARNINGS 1

int GetMonthDay(int year, int month)
{
    int arr[] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
    if (month == 2 && (((year % 4 == 0) && year % 100 != 0) || year % 400 == 0))
    {
        return 29;
    }
    return arr[month];
}

int dayOfYear(char* date) {
    int day = (date[8] - 48) * 10 + date[9] - 48;
    int month = (date[5] - 48) * 10 + date[6] - 48;
    int year = (date[0] - 48) * 1000 + (date[1] - 48) * 100 + (date[2] - 48) * 10 + date[3] - 48;
    //printf("%d %d %d",year,month,day);
    for (int i = 1; i < month; i++)
    {
        day += GetMonthDay(year, i);
    }

    return day;
}